<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 17-10-24
 * Time: 下午3:45
 */

namespace wodrow\models;


use ActiveRecord\Model;

/**
 * This is the model class for table "dyhl_attach_file".
 *
 * @property string $af_id
 * @property string $af_class
 * @property string $af_no
 * @property string $af_title
 * @property integer $af_uid
 * @property string $af_path
 * @property string $af_size
 * @property integer $af_filetime
 * @property integer $af_ftp
 * @property string $af_ftpurl
 * @property integer $af_dateline
 */
class AttachFile extends Model
{
    public static $table_name = "dyhl_attach_file";
    
    public static function getFileNameByPath($path)
    {
        $files = self::find('all', array('af_path' => $path));
        $file = $files[0];
//        return $file->af_title;
         return \wodrow\tools\Tools::retrieve($file->af_title);
    }

    public function yii__attributeLabels()
    {
        return array(
            'af_id' => '编号',
            'af_class' => '所属表：如文章article ',
            'af_no' => '所属信息编号 ',
            'af_title' => '附件名',
            'af_uid' => '上传用户编号',
            'af_path' => '路径',
            'af_size' => '大小',
            'af_filetime' => '拍摄时间',
            'af_ftp' => '是否ftp到了附件服务器',
            'af_ftpurl' => 'ftp地址',
            'af_dateline' => '上传时间',
        );
    }
}